import cv2
import numpy as np
if __name__ == '__main__':
    image_np = cv2.imread('zuoye2.jpg')
    angle = 0
    scale = 0.5
    M = cv2.getRotationMatrix2D((0, 0), angle, scale)
    rotation_image = cv2.warpAffine(image_np, M, (image_np.shape[1] * 2, image_np.shape[0] * 2), flags = cv2.INTER_LANCZOS4, borderMode= cv2.BORDER_WRAP)




    cv2.imshow('', rotation_image)
    cv2.imwrite('zuoye3.jpg', rotation_image)
    cv2.waitKey(0)